package shoppingmall.reception.mapper;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import shoppingmall.reception.pojo.CommercialSpecification;

import java.util.List;

/**
 * 商品规格对应的mapper层
 */
@Mapper
public interface CommercialSpecificationMapper {

    /**
     * 查询所有的商品规格信息
     */
    public List<CommercialSpecification> getAllCommercialSpecification ();

    /**
     * 根据商品id commodity_id 获取对应的商品规格集合
     */
    public List<CommercialSpecification> getCommercialSpecificationListByProductId (int productId);

    /**
     * 根据商品规格id(主键) 查询当前的规格信息 [获取用户购物车的数据中需添加该信息]
     */
    @Select("select * from tb_commodity_standard where id = #{standardId}")
    public CommercialSpecification getCommercialSpecificationById (int standardId);
}
